home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 January / EnigmA AMIGA RUN 33 (1999)(G.R. Edizioni)(IT)[!][issue 1999-01].iso / earcd / apus / latest / bh981121.lha / bh981121 / bootstrap.h < prev    next >
C/C++ Source or Header  |  1997-01-15  |  4KB  |  150 lines

  1. /*
  2. ** linux/arch/m68k/boot/amiga/bootstrap.h -- This file is part of the Amiga
  3. **                         bootloader.
  4. **
  5. ** Copyright 1993, 1994 by Hamish Macdonald
  6. **
  7. ** Some minor additions by Michael Rausch 1-11-94
  8. ** Modified 11-May-94 by Geert Uytterhoeven
  9. **            (Geert.Uytterhoeven@cs.kuleuven.ac.be)
  10. **     - inline Supervisor() call
  11. ** Modified 10-Jan-96 by Geert Uytterhoeven
  12. **     - The real Linux/m68k boot code moved to linuxboot.[ch]
  13. ** Modified 9-Sep-96 by Geert Uytterhoeven
  14. **     - const library bases
  15. **     - fixed register naming for m68k-cbm-amigados-gcc
  16. **
  17. ** This file is subject to the terms and conditions of the GNU General Public
  18. ** License.  See the file COPYING in the main directory of this archive
  19. ** for more details.
  20. **
  21. */
  22.  
  23.  
  24. struct MsgPort {
  25.     u_char fill1[15];
  26.     u_char mp_SigBit;
  27.     u_char fill2[18];
  28. };
  29.  
  30. struct IOStdReq {
  31.     u_char fill1[20];
  32.     struct Device *io_Device;
  33.     u_char fill2[4];
  34.     u_short io_Command;
  35.     u_char io_Flags;
  36.     char io_Error;
  37.     u_long io_Actual;
  38.     u_long io_Length;
  39.     void *io_Data;
  40.     u_char fill4[4];
  41. };
  42.  
  43. #define IOF_QUICK    (1<<0)
  44.  
  45. struct timerequest {
  46.     u_char fill1[28];
  47.     u_short io_Command;
  48.     u_char io_Flags;
  49.     u_char fill2[1];
  50.     u_long tv_secs;
  51.     u_long tv_micro;
  52. };
  53.  
  54. #define UNIT_VBLANK    1
  55. #define TR_ADDREQUEST    9
  56.  
  57.  
  58. struct Library;
  59. struct IORequest;
  60.  
  61.  
  62. static __inline char OpenDevice(u_char *devName, u_long unit,
  63.                 struct IORequest *ioRequest, u_long flags)
  64. {
  65.     register char _res __asm("d0");
  66.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  67.     register u_char *a0 __asm("a0") = devName;
  68.     register u_long d0 __asm("d0") = unit;
  69.     register struct IORequest *a1 __asm("a1") = ioRequest;
  70.     register u_long d1 __asm("d1") = flags;
  71.  
  72.     __asm __volatile ("jsr a6@(-0x1bc)"
  73.               : "=r" (_res)
  74.               : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1)
  75.               : "a0","a1","d0","d1", "memory");
  76.     return(_res);
  77. }
  78.  
  79. static __inline void CloseDevice(struct IORequest *ioRequest)
  80. {
  81.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  82.     register struct IORequest *a1 __asm("a1") = ioRequest;
  83.  
  84.     __asm __volatile ("jsr a6@(-0x1c2)"
  85.               : /* no output */
  86.               : "r" (a6), "r" (a1)
  87.               : "a0","a1","d0","d1", "memory");
  88. }
  89.  
  90. static __inline char DoIO(struct IORequest *ioRequest)
  91. {
  92.     register char _res __asm("d0");
  93.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  94.     register struct IORequest *a1 __asm("a1") = ioRequest;
  95.  
  96.     __asm __volatile ("jsr a6@(-0x1c8)"
  97.               : "=r" (_res)
  98.               : "r" (a6), "r" (a1)
  99.               : "a0","a1","d0","d1", "memory");
  100.     return(_res);
  101. }
  102.  
  103. static __inline void *CreateIORequest(struct MsgPort *port, u_long size)
  104. {
  105.     register struct Library *_res __asm("d0");
  106.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  107.     register struct MsgPort *a0 __asm("a0") = port;
  108.     register u_long d0 __asm("d0") = size;
  109.  
  110.     __asm __volatile ("jsr a6@(-0x28e)"
  111.               : "=r" (_res)
  112.               : "r" (a6), "r" (a0), "r" (d0)
  113.               : "a0","a1","d0","d1", "memory");
  114.     return(_res);
  115. }
  116.  
  117. static __inline void DeleteIORequest(void *ioRequest)
  118. {
  119.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  120.     register void *a0 __asm("a0") = ioRequest;
  121.  
  122.     __asm __volatile ("jsr a6@(-0x294)"
  123.               : /* no output */
  124.               : "r" (a6), "r" (a0)
  125.               : "a0","a1","d0","d1", "memory");
  126. }
  127.  
  128. static __inline struct MsgPort *CreateMsgPort(void)
  129. {
  130.     register struct MsgPort *_res __asm("d0");
  131.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  132.  
  133.     __asm __volatile ("jsr a6@(-0x29a)"
  134.               : "=r" (_res)
  135.               : "r" (a6)
  136.               : "a0","a1","d0","d1", "memory");
  137.     return(_res);
  138. }
  139.  
  140. static __inline void DeleteMsgPort(struct MsgPort *port)
  141. {
  142.     register const struct ExecBase *a6 __asm("a6") = SysBase;
  143.     register struct MsgPort *a0 __asm("a0") = port;
  144.  
  145.     __asm __volatile ("jsr a6@(-0x2a0)"
  146.               : /* no output */
  147.               : "r" (a6), "r" (a0)
  148.               : "a0","a1","d0","d1", "memory");
  149. }
  150.